luci-mod-network: allow device declarations and device configs to coexist
authorJo-Philipp Wich <[email protected]>
Sat, 5 Jun 2021 16:41:39 +0000 (18:41 +0200)
committerJo-Philipp Wich <[email protected]>
Sat, 12 Jun 2021 18:01:57 +0000 (20:01 +0200)
commitb9b279c4cc4c59e995afd4008e1ff4ea2091d25d
tree3214865a9dbdbc45e841f62c3beeb8b6aebbceb8
parentd721bb6875fecc4c783404954af958ab09de76f8
luci-mod-network: allow device declarations and device configs to coexist

It is legal to have two device sections referring to the same netdev if one
section is a declaration (a section setting option type) and the other is
a configuration (a section not specifying a type but matching an existing
netdev).

Support this case in LuCI since it might be required for some complex
device setups.

Additionally, fix the device type determination for device configuration
sections without type, those should be treated as ethernet (a.k.a.
simple device) configuration instead of falling back to the underlying
netdev device type.

Signed-off-by: Jo-Philipp Wich <[email protected]>
(cherry picked from commit a6c0ad00b28a5d3f91338b50f7e69fbd45f2154e)
modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js